package com.ruoyi.hospital.service.member.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.hospital.mapper.member.MemberLevelMapper;
import com.ruoyi.hospital.domain.member.MemberLevel;
import com.ruoyi.hospital.service.member.IMemberLevelService;

/**
 * 用户设置Service业务层处理
 * 
 * @author wendao
 * @date 2024-08-16
 */
@Service
public class MemberLevelServiceImpl implements IMemberLevelService 
{
    @Autowired
    private MemberLevelMapper memberLevelMapper;

    /**
     * 查询用户设置
     * 
     * @param id 用户设置主键
     * @return 用户设置
     */
    @Override
    public MemberLevel selectMemberLevelById(Integer id)
    {
        return memberLevelMapper.selectMemberLevelById(id);
    }

    /**
     * 查询用户设置列表
     * 
     * @param memberLevel 用户设置
     * @return 用户设置
     */
    @Override
    public List<MemberLevel> selectMemberLevelList(MemberLevel memberLevel)
    {
        return memberLevelMapper.selectMemberLevelList(memberLevel);
    }

    /**
     * 新增用户设置
     * 
     * @param memberLevel 用户设置
     * @return 结果
     */
    @Override
    public int insertMemberLevel(MemberLevel memberLevel)
    {
        memberLevel.setCreateTime(DateUtils.getNowTimeSecond());
        return memberLevelMapper.insertMemberLevel(memberLevel);
    }

    /**
     * 修改用户设置
     * 
     * @param memberLevel 用户设置
     * @return 结果
     */
    @Override
    public int updateMemberLevel(MemberLevel memberLevel)
    {
        memberLevel.setUpdateTime(DateUtils.getNowTimeSecond());
        return memberLevelMapper.updateMemberLevel(memberLevel);
    }

    /**
     * 批量删除用户设置
     * 
     * @param ids 需要删除的用户设置主键
     * @return 结果
     */
    @Override
    public int deleteMemberLevelByIds(Integer[] ids)
    {
        return memberLevelMapper.deleteMemberLevelByIds(ids);
    }

    /**
     * 删除用户设置信息
     * 
     * @param id 用户设置主键
     * @return 结果
     */
    @Override
    public int deleteMemberLevelById(Integer id)
    {
        return memberLevelMapper.deleteMemberLevelById(id);
    }
}
